#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
using namespace std;
typedef unsigned long long ULL;
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        ULL a, b, c, k;
        cin >> a >> b >> c >> k;
        while (k--)
        {
            ULL a1 = (b + c) / 2;
            ULL b1 = (a + c) / 2;
            ULL c1 = (a + b) / 2;
            a = a1;
            b = b1;
            c = c1;
            if (a == b && b == c && a == c)
                break;
        }
        cout << a << " " << b << " " << c << "\n";
    }
    return 0;
}